﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Web;
using System.ServiceModel.Web;
using System.ServiceModel.Activation;
namespace MapService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]

    public interface IService1
    {
        // TODO: Add your service operations here

        [OperationContract]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, UriTemplate = "TK?user_name={user_name}&pw={pw}")]
        TAIKHOAN getTK(string user_name, string pw);
        [OperationContract]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, UriTemplate = "getContacts?id_user={id_user}")]
       List< TAIKHOAN> getContacts(int id_user);

        [OperationContract]
        [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, UriTemplate = "TK")]
        bool SaveTK(TAIKHOAN sv);

        [OperationContract]
        [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, UriTemplate = "AddNewContact?id_user={id_user}&contact_name={contact_name}")]
        string AddNewContact(int id_user,string  contact_name);

        [OperationContract]
        [WebInvoke(Method = "PUT", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, UriTemplate = "TK")]
        Boolean updateTK(TAIKHOAN Sv);

        [OperationContract]
        [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, UriTemplate = "DiaDiem")]
        bool SaveDiaDiem(DIADIEM _diadiem);
        [OperationContract]
        [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, UriTemplate = "ShareDiaDiem?id_user={id_user}&id_diadiem={id_diadiem}")]
        bool ShareDiaDiem(int id_user, int  id_diadiem);

        [OperationContract]
        [WebInvoke(Method = "PUT", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, UriTemplate = "UpdateDD")]
        bool Update(DIADIEM _diadiem);

        [OperationContract]
        [WebInvoke(Method = "DELETE", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, UriTemplate = "DiaDiem?ID={ID}")]
        Boolean deleteDiaDiem(int ID);

        [OperationContract]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, UriTemplate = "DiaDiemFromDV?ID_DichVu={id}")]
        List<DIADIEM> getDSDiaDiemFromDichVu(int id);

        [OperationContract]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, UriTemplate = "DiaDiems?id_user={id_user}")]
        List<DIADIEM> getDSDiaDiemFromUSer(int id_user);
        [OperationContract]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, UriTemplate = "getDSDiaDiemFromUSerAndDV?id_user={id_user}&id_div={id_dv}")]
        List<DIADIEM> getDSDiaDiemFromUSerAndDV(int id_user,int id_dv);

        [OperationContract]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, UriTemplate = "getDiaDiemFromID?id_user={id_user}")]
        DIADIEM getDiaDiemFromID(int id_user);
        
        [OperationContract]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, UriTemplate = "getAllDV")]
        List<DICHVU> getAllDV();

        [OperationContract]
        [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, UriTemplate = "SearchNearBy?id_diadiem={id_diadiem}")]
        DIADIEM SearchNearBy(int id_diadiem);
    }

    // Use a data contract as illustrated in the sample below to add composite types to service operations

}
